package com.aidansmeaton.weightmanager.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

import com.aidansmeaton.weightmanager.R;

public class EmoticonAdapter extends BaseAdapter {
    private Context mContext;

    private Integer[] mImageIds = {
            R.drawable.ic_emo_00,
            R.drawable.ic_emo_01,
            R.drawable.ic_emo_02,
            R.drawable.ic_emo_03,
            R.drawable.ic_emo_04,
            R.drawable.ic_emo_05,
            R.drawable.ic_emo_06,
            R.drawable.ic_emo_07,
            R.drawable.ic_emo_08,
            R.drawable.ic_emo_09,
            R.drawable.ic_emo_10,
            R.drawable.ic_emo_11,
            R.drawable.ic_emo_12,
            R.drawable.ic_emo_13,
            R.drawable.ic_emo_14,
            R.drawable.ic_emo_15,
            R.drawable.ic_emo_16,
            R.drawable.ic_emo_17
    };

    public EmoticonAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mImageIds.length;
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView = new ImageView(mContext);

        imageView.setImageResource(mImageIds[position]);
        imageView.setLayoutParams(new Gallery.LayoutParams(150, 100));
        imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);

        return imageView;
    }
}